]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
notificationDaemon: handle trayicon clicks in the overview
authorDan Winship <danw@gnome.org>
Wed, 16 Mar 2011 17:16:38 +0000 (13:16 -0400)
committerDan Winship <danw@gnome.org>
Mon, 21 Mar 2011 18:58:10 +0000 (14:58 -0400)
If the user clicks a trayicon in the overview, drop out of the
overview before passing the click on to the icon. (We have to actually
wait for the overview animation to complete, in case the icon wants to
get a pointer grab, which it would not be able to do with the overview
active.)

https://bugzilla.gnome.org/show_bug.cgi?id=641853

js/ui/notificationDaemon.js

index c3c1e34b710e42e6406bf79d47f0ed0409d430f1..2a59d983342dbc4eb955d69d6fe8375cd96369f4 100644 (file)
@@ -461,7 +461,18 @@ Source.prototype = {
         if (event.type() != Clutter.EventType.BUTTON_RELEASE)
             return false;
 
-        this._trayIcon.click(event);
+        if (Main.overview.visible) {
+            // We can't just connect to Main.overview's 'hidden' signal,
+            // because it's emitted *before* it calls popModal()...
+            let id = global.connect('notify::stage-input-mode', Lang.bind(this,
+                function () {
+                    global.disconnect(id);
+                    this._trayIcon.click(event);
+                }));
+            Main.overview.hide();
+        } else {
+            this._trayIcon.click(event);
+        }
         return true;
     },